<?php


namespace app\api\controller;


use app\BaseController;
use app\common\lib\Snowflake;
use app\common\lib\Upload;
use think\facade\Cache;
use think\file\UploadedFile;

class cart extends BaseController
{
    public function index()
    {
        return 1;
        $arr = [
            'a' => 1,
            'a1' => 1
        ];
        Cache::hSet('test', 1, json_encode($arr));
    }

    public function get()
    {
        dump(Cache::hGet('test', 1));
        dump(Cache::hGet('test', 2));
    }


    public function snow()
    {
        dump(Snowflake::getInstance()->id());

    }

    public function img()
    {
        $param = input('');
        dump($_FILES);
         $res= Upload::image($_FILES);
         dump($res);
    }

}